package test;

public class Demo {
    public void syn(){
        synchronized (this) {
            synchronized (this) {
                syn2();
                System.out.println("hello");
            }
        }
    }   public void syn2(){
        synchronized (this) {
            synchronized (this) {
                System.out.println("hello2");
            }
        }
    }

    public static void main(String[] args) {
        new Demo().syn();
    }

}
